var ul = $("ul");
var x = 0;
var speed=-1;
var li_h = $("ul li").outerHeight(true);
ul.append(ul.html());
var li_size = $("ul li").length;
var a = li_size * li_h * 0.5;
ul.css("height",a*2);
var div = $(".div2");
var tick;
$(document).ready(function () {
    auto();
});
div.hover(function () {
    clearInterval(tick);
}, function () {
    auto();
});
function auto() {
    tick = setInterval(function () {
        if (x <= -a) {
            x = 0;
        }
        ul.css({"top": x += speed});
    }, 100);
};
